package com.dingding.common.core.util;

import org.apache.commons.codec.digest.DigestUtils;
import org.junit.Test;

/**
 * 
 * @ClassName: MD5Util
 * @Description: MD5加密
 * @author cheshaowei
 * @date 2015-9-17 下午07:44:22
 */
public class MD5Util {

	/**
	 * @Title: md5Encrypt 
	 * @Description:md5加密
	 * @author cheshaowei
	 * @throws
	 */
	public static String md5Encrypt(String str) {

		if (ToolUtil.isBlank(str)) {
			return null;
		}
		// 执行md5加密
		String encrypteStr = DigestUtils.md5Hex(str);

		return encrypteStr;

	}

	/**
	 *
	 * @Title: test 
	 * @Description: md5加密测试
	 * @author cheshaowei
	 * @throws
	 * 
	 */
	@Test
	public void test() {

		String str = md5Encrypt("车焕波");
		System.out.println(str);

	}
}
